<%@ page import="java.util.Date" %><%--
  Created by IntelliJ IDEA.
  User: oldliu
  Date: 2021/3/20
  Time: 10:38
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
 <%
     String id=session.getId();

     //session.removeAttribute();
     long time=session.getCreationTime();//创建时间
     long lasttime=session.getLastAccessedTime();
     int livetime=session.getMaxInactiveInterval();
 %>
<h1>编号：<%=id%></h1>
<h1>创建时间：<%=new Date(time)%></h1>
<h1>最近访问时间：<%=new Date(lasttime)%></h1>
<h1>最大间隔时间：<%=livetime%>秒</h1>
</body>
</html>
